﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SIOsystem
{
    public partial class MainForm : Form
    {
        public string uname = "";
        public long id = -1;
        InForm inform = null;
        OutForm outform = null;
        ReportForm reportform = null;
        ConfigForm configform = null;
        public MainForm()
        {
            InitializeComponent();
        }

        private void navInForm_Click(object sender, EventArgs e)
        {
            if (inform == null || inform.Visible == false)
            {
                inform = new InForm();
                inform.uname = this.uname;
                inform.id = this.id;
                inform.Show();
            }
            inform.WindowState = FormWindowState.Normal;
            inform.Activate();
        }

        private void navOutForm_Click(object sender, EventArgs e)
        {
            if (outform == null || outform.Visible == false)
            {
                outform = new OutForm();
                outform.uname = this.uname;
                outform.id = this.id;
                outform.Show();
            }
            outform.WindowState = FormWindowState.Normal;
            outform.Activate();
        }

        private void navReportForm_Click(object sender, EventArgs e)
        {
            if (reportform == null || reportform.Visible == false)
            {
                reportform = new ReportForm();
                reportform.uname = this.uname;
                reportform.id = this.id;
                reportform.Show();
            }
            reportform.WindowState = FormWindowState.Normal;
            reportform.Activate();
        }

        private void navConfigForm_Click(object sender, EventArgs e)
        {
            if (configform == null || configform.Visible == false)
            {
                configform = new ConfigForm();
                configform.uname = this.uname;
                configform.id = this.id;
                configform.Show();
            }
            configform.WindowState = FormWindowState.Normal;
            configform.Activate();
        }
    }
}
